package com.tiger.userClient.http.card;

import com.tiger.userClient.http.card.dto.PageDto;
import com.tiger.utils.ResponseUtil;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("card")
public class CardController {
    private final CardService cardService;

    public CardController(CardService cardService) {
        this.cardService = cardService;
    }


    @GetMapping("card")
    public Object card(@RequestAttribute("userKey") String userKey) { //230774002003
        System.out.println("card userKey");
        System.out.println(userKey);
        return ResponseUtil.successRes(cardService.card(userKey));
    }


    @PostMapping("log")
    public Object log(@RequestBody PageDto dto, @RequestAttribute("userKey") String userKey) {
        return ResponseUtil.successRes(cardService.log(dto, userKey));
    }
}
